package com.zy.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class SpringWebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
  /**
   * 指定spring容器的配置类
   * @return
   */
  @Override
  protected Class<?>[] getRootConfigClasses() {
    return new Class[] { SpringConfig.class };
  }

  /**
   * springmvc容器的配置类
   * @return
   */
  @Override
  protected Class<?>[] getServletConfigClasses() {
    return new Class[] { SpringMvcConfig.class };
  }

  /**
   * 配置拦截请求路径
   * @return
   */
  @Override
  protected String[] getServletMappings() {
    return new String[] { "/" };
  }
}